package com.pcbly.web.business.dict;

import java.util.List;

import com.pcbly.web.bean.dict.DictCategoryAddChildBean;
import com.pcbly.web.bean.dict.DictCategoryBean;
import com.pcbly.web.business.BaseServiceImp;
import com.pcbly.web.persistence.dict.DictCategoryCombDao;
import com.pcbly.web.persistence.dict.DictCategoryDao;
import com.pcbly.web.persistence.dict.DictCategoryDependDao;
import com.pcbly.web.persistence.dict.DictCategoryFilterDao;
import com.pcbly.web.persistence.dict.DictCategoryValueDao;

public class DictCategoryServiceImp extends BaseServiceImp<DictCategoryBean>
		implements DictCategoryService {

	public DictCategoryServiceImp() {
		super();
		// TODO Auto-generated constructor stub
	}

	/**
	 * 
	 */
	private static final long serialVersionUID = -1168507614838327399L;

	private DictCategoryDao dictCategoryDao;
	private DictCategoryCombDao dictCategoryCombDao;
	private DictCategoryFilterDao dictCategoryFilterDao;
	private DictCategoryDependDao dictCategoryDependDao;
	private DictCategoryValueDao dictCategoryValueDao;

	public void setDictCategoryValueDao(
			DictCategoryValueDao dictCategoryValueDao) {
		this.dictCategoryValueDao = dictCategoryValueDao;
	}

	public void setDictCategoryCombDao(DictCategoryCombDao dictCategoryCombDao) {
		this.dictCategoryCombDao = dictCategoryCombDao;
	}

	public void setDictCategoryFilterDao(
			DictCategoryFilterDao dictCategoryFilterDao) {
		this.dictCategoryFilterDao = dictCategoryFilterDao;
	}

	public void setDictCategoryDependDao(
			DictCategoryDependDao dictCategoryDependDao) {
		this.dictCategoryDependDao = dictCategoryDependDao;
	}

	public void setDictCategoryDao(DictCategoryDao dictCategoryDao) {
		this.dictCategoryDao = dictCategoryDao;
	}

	public List<DictCategoryAddChildBean> queryAllDictCategoryAddChild()
			throws Exception {
		return dictCategoryDao.queryAllDictCategoryAddChild();
	}

	@Override
	public DictCategoryBean findById(String id) throws Exception {
		// TODO Auto-generated method stub
		return dictCategoryDao.findById(id);
	}

	@Override
	public void removeDictCategoryById(String id) throws Exception {
		// TODO Auto-generated method stub
		dictCategoryValueDao.removeDictCategoryValueByDictId(id);
		dictCategoryFilterDao.removeDictCategoryFilterByDictId(id);
		dictCategoryDependDao.removeDictCategoryDependByDictId(id);
		dictCategoryCombDao.removeDictCategoryCombByDictId(id);
		dictCategoryDao.removeDictCategoryById(id);
	}

	@Override
	public List<DictCategoryBean> queryAllDictCategory() throws Exception {
		// TODO Auto-generated method stub
		return dictCategoryDao.getAll();
	}

	@Override
	public void createDictCategoryBean(DictCategoryBean bean) throws Exception {
		// TODO Auto-generated method stub
		dictCategoryDao.createDictCategoryBean(bean);
	}

	@Override
	public void updateDictCategoryBean(DictCategoryBean bean) throws Exception {
		// TODO Auto-generated method stub
		dictCategoryDao.updateDictCategoryBean(bean);
	}

	@Override
	public List<DictCategoryBean> queryDictCategoryBeanByMasterId(
			String masterId) throws Exception {
		// TODO Auto-generated method stub

		return dictCategoryDao.queryDictCategoryBeanByMasterId(masterId);
	}

}
